package com.hmall.common.clients;

import com.hmall.common.dto.PageDTO;
import com.hmall.common.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("itemservice")
@RequestMapping("item")
public interface ItemClient {
    @GetMapping("/list")
    public PageDTO<Item> list(@RequestParam("page") Integer page, @RequestParam("size")Integer size);

    @GetMapping("/{id}")
    public Item getById(@PathVariable("id") Long id);

    @PutMapping("/stock/{itemId}/{num}")
    public void stock(@PathVariable Long itemId, @PathVariable Integer num);


    @PutMapping("/recover")
    public void recoverStock(@RequestBody Item item);

}
